<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<div class="sf_admin_form">
  <?php echo form_tag_for($form, '@product_type') ?>
    <?php echo $form->renderHiddenFields(false) ?>

    <?php if ($form->hasGlobalErrors()): ?>
      <?php echo $form->renderGlobalErrors() ?>
    <?php endif; ?>
    <fieldset id="sf_fieldset_none">
		<div class="sf_admin_form_row sf_admin_text sf_admin_form_field_name">
			<div>
		        <label>Name</label>
			    <div class="content">
			    	<input type="text" id="product_type_name" value="<?php echo $product_type->getName(); ?>" name="product_type[name]">
			    </div>
		    </div>
		  </div>    
		<div class="sf_admin_form_row sf_admin_text sf_admin_form_field_name">
			<div>
		      <label>Download types</label>
		      <div class="content">
		    <?php
		    	$arr_temp = array();
		    	foreach($arr_exist_download_type as $download_type_id)
		    	{
		    		$arr_temp[] = $download_type_id;
		    	}	
		    ?>
		      <select multiple="multiple" id="product_type_has_download_types" name="product_type_has_download_types[]">
		      <?php foreach($downloadTypeList as $downloadType):?>
		      	<option value="<?php echo $downloadType->getId();?>" <?php if(in_array($downloadType->getId(),$arr_temp)) echo "selected"?>><?php echo $downloadType->getName();?></option>
		      <?php endforeach;?>
		      </select>
		      </div>
		    </div>
		</div>
    </fieldset>
    <?php include_partial('product_type/form_actions', array('product_type' => $product_type, 'form' => $form, 'configuration' => $configuration, 'helper' => $helper)) ?>
  </form>
</div>
